package com.doitedu.mr.day07.skew;

import java.util.Random;

/**
 * @Date 2021/12/9
 * @Created by HANGGE
 * @Description TODO
 */
public class Test01 {
    public static void main(String[] args) {
        // 两个reduce程序
        String[] strs = new String[]{"a","a","a","a","c","c","b"} ;
        Random random = new Random();


        for (String str : strs) {
            int i = random.nextInt(2);
            // 单词后面添加随机数据
            int p =  (str+"-"+i).hashCode()%2;
            System.out.println(str+"-"+i+"   "+str+"会被分到"+p+"号分区");
        }
    }
}
